#ifndef __GRAPH_H
#define __GRAPH_H

typedef unsigned int uint;
struct Node {
	uint id;
	float weight;
	int inDegree;
	struct Node* next;
};

typedef struct Node * PtrToNode;
struct Graph {
	int capacity;
	int vertexNum;
	PtrToNode* nodeList;
};

typedef struct Graph* PtrToGraph;


PtrToNode createNode(uint id, float weight);
PtrToGraph initGraph(int capacity);
PtrToNode find(PtrToGraph graph, uint id);
void addNodeById(PtrToGraph graph, uint id);
void printAllNode(PtrToGraph graph);
void addEdge(PtrToGraph graph, uint id1, uint id2, float weight);

#endif